from appium import webdriver
from time import sleep
from appium.webdriver.common.appiumby import By
import sys
sys.path.append(r'..')
from common.common_fun import Common
from common.desired_caps import desired_caps
class LoginPage(Common):
    username_loc = (By.ID, 'com.tal.kaoyan:id/login_email_edittext')
    password_loc = (By.ID, 'com.tal.kaoyan:id/login_password_edittext')
    login_btn_loc = (By.ID, 'com.tal.kaoyan:id/login_login_btn')
    def __init__(self,driver):
        super().__init__(driver)
    def login(self,username,password):
        self.check_cancel()
        self.check_skip()
        self.ele_input(self.username_loc,username,'用户名输入框')
        self.ele_input(self.password_loc,password,'密码输入框')
        self.ele_click(self.login_btn_loc)
        sleep(3)
if __name__ == '__main__':
    username=''
    password='ammyxh01'
    driver=desired_caps()
    login=LoginPage(driver)
    login.login(username,password)
    sleep(3)
    driver.quit()
